/*
 * PersonManagerLauncher.fx
 *
 * Created on 20.03.2010, 13:58:06
 */

package javafx191labs.nkornilova.seminar01.main;


import javafx.stage.Stage;
import javafx.scene.Scene;
import javafx191labs.ssheypak.seminar01.gui.CreatePersonForm;
import javafx191labs.ssheypak.seminar01.gui.FormRow;
import javafx.ext.swing.SwingTextField;
import javafx191labs.ssheypak.common.data.Person;
import javafx191labs.nkornilova.seminar01.view.CreateManagerForm;
import javafx191labs.nkornilova.seminar01.data.Manager;
import javafx.scene.input.MouseEvent;

/**
 * @author ssheipak
 */

Stage {
    var createmanager : CreateManagerForm = CreateManagerForm{title:"Записать данные о сотруднике"};

    title: "Управление персоналом.{createmanager.title}";
    scene: Scene {
        width: 400
        height: 600
        content: [
            createmanager = CreateManagerForm{
                    layoutX: 10;
                    layoutY: 20;
                model: Manager{}
                description: "Создание карточки сотрудника"
                //title: "Записать данные о сотруднике"
                var deleteText : SwingTextField[];
                formRows: [
                        FormRow{
                            title: "Имя"
                            description: "Имя сотрудника"
                            uiControl: deleteText[0]=SwingTextField{
                                width:200
                                name: "firstName"
                                onMouseClicked: function( e: MouseEvent ):Void {deleteText[0].text="";}
                            }
                        },
                        FormRow{
                            title: "Фамилия"
                            description: "Фамилия"
                            uiControl: deleteText[1]=SwingTextField{
                                width:200
                                name: "lastName"
                                onMouseClicked: function( e: MouseEvent ):Void {deleteText[1].text="";}
                            }
                        },
                        FormRow{
                            title: "Дата рождения"
                            description: "Дата рождения сотрудника"
                            uiControl: deleteText[2]=SwingTextField{
                                width:200
                                name: "birthDay"
                                onMouseClicked: function( e: MouseEvent ):Void {deleteText[2].text="";}
                            }
                        },
                        FormRow{
                            title: "Департамент"
                            description: "Департамент"
                            uiControl: deleteText[3]=SwingTextField{
                                width:200
                                name: "departmentTitle";
                                onMouseClicked: function( e: MouseEvent ):Void {deleteText[3].text="";}



                            }
                        },
                ]
            }

        ]
    }
}